package kr.go.nih.biomedi.snptorrent.servlet;

import java.io.IOException;	
import java.util.LinkedList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ResultServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	public ResultServlet() {
		super();
	}

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		String chrom = request.getParameter("chrom");
		int chromStart = Integer.parseInt(request.getParameter("chromStart"));
		int chromEnd = Integer.parseInt(request.getParameter("chromEnd"));
		List<Integer> chromRange = new LinkedList<Integer>();
		
		for (int i = chromStart; i <= chromEnd; i = i + 1000) {
			chromRange.add(i);
		}
		
		request.setAttribute("chromRange", chromRange);
				
		request.getRequestDispatcher("/result.jsp").forward(request, response);
	}
}
